<%--
  Created by IntelliJ IDEA.
  User: SWJ
  Date: 2023-04-10
  Time: 17:10
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta charset="UTF-8">
    <title>测试页面</title>
</head>
<body>

    <%!
        private int initVar = 0;
        private int serviceVar = 0;
        private int destroyVar = 0;
    %>


  <%!
      public void jspInit(){
        initVar++;
        System.out.println("JspInit();jsp被初适化了"+ initVar+"次");
  }
  %>

  <%!
    public  void  jspDestroy(){
      destroyVar++;
      System.out.println("Jsp被销毁了");
    }
  %>

  <%
    request.setAttribute("guida","01");
    serviceVar++;
    System.out.println("_jspService():Jsp被初始化了"+ initVar + "次请求");
    String content1 = "初始化次数: "+serviceVar;
    String content2 = "响应客户请求次数: " + serviceVar;
    String content3 = "销毁次数: " + destroyVar;
  %>

<h1>JSP 测试实例</h1>C
<p><%=request.getAttribute("guida")%></p>
<p><%=content1%></p>
<p><%=content2%></p>
<p><%=content3%></p>
</body>

</html>
